{% extends 'oj_base.html' %}
{% block title %}
    我的提交列表
{% endblock %}
{% block body %}

    {% load submission %}
    <div class="container main">
        <ul class="nav nav-tabs nav-tabs-google">
            {% if problem.contest_id %}
                <li role="presentation">
                    <a href="/contest/{{ problem.contest.id }}/problem/{{ problem.id }}/">题目</a></li>
                <li role="presentation" class="active">
                    <a href="/contest/{{ problem.contest.id }}/problem/{{ problem.id }}/submissions/">我的提交</a>
                </li>
            {% else %}
                <li role="presentation">
                    <a href="/problem/{{ problem.id }}/">题目</a></li>
                <li role="presentation" class="active">
                    <a href="/problem/{{ problem.id }}/submissions/">我的提交</a>
                </li>
            {% endif %}
        </ul>
        {% include "oj/problem/_problem_header.html" %}
        {% if submissions %}
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>#</th>
                <th>提交时间</th>
                <th>语言</th>
                <th>运行时间</th>
                <th>结果</th>
            </tr>
            </thead>
            <tbody>
            {% for item in submissions %}
                <tr>
                    <th scope="row">
                        <a href="/submission/{{ item.id }}/">{{ forloop.counter }}</a>
                    </th>
                    <td>{{ item.create_time }}</td>
                    <td>
                        {{ item.language|translate_language }}
                    </td>
                    <td>
                        {% if item.accepted_answer_time != None %}
                            {{ item.accepted_answer_time }}ms
                        {% else %}
                            --
                        {% endif %}
                    </td>
                    <td class="alert-{{ item.result|translate_result_class }}">
                        <strong>{{ item.result|translate_result }}</strong>
                    </td>
                </tr>
            {% endfor %}

            </tbody>
        </table>
        {% else %}
            <p>你还没有提交该题目</p>
        {% endif %}
    </div>
{% endblock %}